#ifndef USERINFOWIDGET_H
#define USERINFOWIDGET_H

#include <QWidget>
#include <QDialog>
#include <QHBoxLayout>

#include "model/data.h"

class QLabel;
using model::UserInfo;

class UserInfoWidget : public QDialog
{
    Q_OBJECT

    struct InfoLine
    {
        QLabel* key;
        QLabel* val;
        InfoLine(const QString& keyString, const QString &valString);
    };

public:
    UserInfoWidget(QWidget* parent, const UserInfo& userInfo);

private:
    void initSignalSlot();

    void onClickedByDeleteFriendBtn();

    void onClickedByApplyBtn();

private:
    QPushButton* createButton(const QString& text);

private:
    const UserInfo& userInfo;

    QPushButton* avatarBtn;
    InfoLine* idInfo;
    InfoLine* nameInfo;
    InfoLine* phoneInfo;

    QPushButton* applyBtn;
    QPushButton* sendMessageBtn;
    QPushButton* deleteFriendBtn;
};

#endif // USERINFOWIDGET_H
